<template>
  <div>
    <h2>我的</h2>
  </div>
</template>

<script>
export default {
  data() {
    return {
      info: "涵涵看啥呢？？",
    };
  },
  // 进入路由组件前
  beforeRouteEnter(to, from, next) {
    console.log(to);
    console.log(from);
    // console.log(this);
    // next();
    next((component) => {
      console.log(component);
      console.log(component.info);
    });
  },
  beforeRouteLeave(to, from, next) {
    // 主要做些收尾工作 例如清除定时器
    console.log(to);
    console.log(from);
    next();
  },
};
</script>

<style lang="scss" scoped>
</style>